class Solution {
public:
    vector<vector<int>> generate(int numRows) {

        vector<vector<int>> ss(numRows);
        for (int i = 0; i < numRows; i++)
        {
            ss[i] = vector<int>(i + 1, 0);
            ss[i].front() = ss[i].back() = 1;
        }

        for (int i = 2; i < numRows; i++)
        {
            for (int j = 1; j < ss[i].size() - 1; j++)
            {
                ss[i][j] = ss[i - 1][j] + ss[i - 1][j - 1];
            }
        }
        return ss;
    }
};